package com.excetop.xservlet.req.param;

/**
 * long 参数
 * @author xuZW
 *
 */
public class LongParam extends TextParam {

	/**
	 * long 参数值
	 */
	private long longValue;
	
	/**
	 * long 参数值数组
	 */
	private long[] longValueArray;
	
	public LongParam() {
	}
	
	public LongParam(String name, String[] textValueArray) {
		this(name, textValueArray, null);
	}
	
	public LongParam(String name, String[] textValueArray, String[] patternArray) {
		super(name, textValueArray, patternArray);
		setType(TYPE_LONG);
		String[] values = getTextValueArrayWithoutSpaceCharacter();
		if(null != values && values.length > 0){
			longValueArray = new long[values.length];
			for (int i = 0; i < longValueArray.length; i++) {
				try { longValueArray[i] = Long.valueOf(values[i]); }
				catch (Exception e) {}
			}
		}
		String value = getTextValueWithoutSpaceCharacter();
		if(null != value){
			try { longValue = Long.valueOf(value); }
			catch (Exception e) {}
		}
	}
	
	public long getLongValue() {
		return longValue;
	}

	public void setLongValue(long longValue) {
		this.longValue = longValue;
	}

	public long[] getLongValueArray() {
		return longValueArray;
	}

	public void setLongValueArray(long[] longValueArray) {
		this.longValueArray = longValueArray;
	}

	@Override
	public boolean verifying() {
		boolean result = true;
		// TODO Auto-generated method stub
		return result;
	}
	
}
